﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BusinessLogic.ServiceClients;

namespace RusIS.CMS.Controllers
{
    public class ProductController : Controller
    {
        //
        // GET: /Product/

        public ActionResult ProductList()
        {
            //var list = new List<BusinessLogic.Entities.ProductEntity>();
            //list.Add(new BusinessLogic.Entities.ProductEntity() { Id = 1, Name = "one" });
            //list.Add(new BusinessLogic.Entities.ProductEntity() { Id = 2, Name = "two" });
            //list.Add(new BusinessLogic.Entities.ProductEntity() { Id = 3, Name = "three" });

            var list = new ProductClient().ProductsByCategory();

            var model = new rusisControls.MVC.Models.PagedViewModel<BusinessLogic.Entities.ProductEntity>
            {
                ViewData = ViewData,
                Query = list.AsQueryable()
            };
            model.Setup();

            return View(model);
        }

    }
}
